package cn.tedu.ykmall.commodity.webapi.service;

import cn.tedu.ykmall.commodity.service.ICommodityService;
import cn.tedu.ykmall.commodity.webapi.mapper.CommodityMapper;
import cn.tedu.ykmall.pojo.commodity.dto.CategorySpuInfoDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 前台商品的业务逻辑层的实现类
 */
@Service
public class CommodityServiceImpl implements ICommodityService {
    //自动注入CommodityMapper
    @Autowired
    CommodityMapper commodityMapper;

    /**
     * 根据id获取商品信息的抽象方法的具体实现
     * @param id
     * @return
     */
    @Override
    public CategorySpuInfoDTO getCommodityInfoById(Long id) {
        CategorySpuInfoDTO commodity = commodityMapper.getCommodityInfoById(id);
        return commodity;
    }
}
